Prior to this analysis, 2´3´-cyclic phosphate RNA-sequencing libraries were prepared from mouse macrophages: B6 (WT) and RNaseL KO. These cells were either mock infected or infected with WT MHV virus (from Volker), MHV mutated to inactivate ns2 (phosphodiesterase) activity, or MHV mutated to inactivate nsp15 (endoribonuclease) activity for 9 and 12 hours.

These libraries were processed to generate bedgraph files containing sites of 3´-cleavage and the associated dinucleotide for 18S, 28S, 5.8s and 5s rRNA.

library(tidyverse)
library(readr)
library(dplyr)
library(ggplot2)
library(stringr)
library(cowplot)
library(RColorBrewer)
library(purrr)
library(shiny)
library(DT)

Coverage plots for 18S, 28S, and 5s rRNA by cell type and type of viral infection

These plots display coverage across the entire 18S, 28S, and 5s rRNA sequence. Counts are normalized by library size.

18s rRNA

sample_info_table <- read_tsv("sample_info_exp2.txt", col_names = c("cell type", "virus type", "time"))
datatable(sample_info_table)
#18S rRNA coverage plots

data_dir_18S = "~/Dropbox (Hesselberth Lab)/Rachel_data/EndoU_project/18S/exp2/"
data_files_18S = list.files(data_dir_18S, full.names = T)

read_file <- function(x) {
  df <- readr::read_tsv(x, col_names = c("chrom", "start", "end", "count", "normalized_count", "dinuc"))
  df$name <- basename(x)
  df
}

table_18S <- purrr::map_df(data_files_18S, read_file) %>%
  mutate(name = str_replace(name, ".r18s.bg", "")) %>%
  separate(name, into = c('cell', 'virus', 'time'), sep = '_')

datatable(table_18S)
## Warning in instance$preRenderHook(instance): It seems your data is too
## big for client-side DataTables. You may consider server-side processing:
## https://rstudio.github.io/DT/server.html
plot_18S <- ggplot(table_18S, aes(x = start, y = normalized_count, fill = time, width = 5)) +
    geom_bar(stat = "identity", position = 'identity') +
    scale_fill_brewer(palette="Set1") +
    theme_cowplot() +
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 60, hjust = 1)) + 
    scale_x_continuous(breaks=seq(0, 2000, 250)) + 
    labs(x="Position", y="Normalized counts (counts/total reads)") +
    ggtitle("18S rRNA coverage plots")
plot_18S

# Previously documented RNaseL cleavage site 542 and 771 in 18S rRNA

plot_18S_542 <- ggplot(table_18S, aes(x = start, y = normalized_count, fill = time)) +
    geom_bar(stat = "identity", position = 'dodge') +
    scale_fill_brewer(palette = 'Set1') + 
    theme_cowplot() +
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 60, hjust = 1)) +
    labs(x="Position", y="Normalized counts (counts/total reads)") +
    xlim(530, 560) +
    ggtitle("RNaseL cleavage site 542 in 18S rRNA")
plot_18S_542
## Warning: Removed 26493 rows containing missing values (geom_bar).

plot_18S_771 <- ggplot(table_18S, aes(x = start, y = normalized_count, fill = time)) +
    geom_bar(stat = "identity", position = 'dodge') +
    scale_fill_brewer(palette = 'Set1') + 
    theme_cowplot() +
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 60, hjust = 1)) +
    labs(x="Position", y="Normalized counts (counts/total reads)") +
    xlim(760, 780) +
    ggtitle("RNaseL cleavage site 771 in 18S rRNA")
plot_18S_771
## Warning: Removed 26643 rows containing missing values (geom_bar).

28s rRNA

#28S rRNA coverage plots

data_files_28S = list.files("~/Dropbox (Hesselberth Lab)/Rachel_data/EndoU_project/28S/exp2/" , full.names = T)

read_file <- function(x) {
  df <- readr::read_tsv(x, col_names = c("chrom", "start", "end", "count", "normalized_count", "dinuc"))
  df$name <- basename(x)
  df
}

table_28S <- purrr::map_df(data_files_28S, read_file) %>%
  mutate(name = str_replace(name, ".r28s.bg", "")) %>%
  separate(name, into = c('cell', 'virus', 'time'), sep = '_')

datatable(table_28S)
plot_28S <- ggplot(table_28S, aes(x = end, y = normalized_count, fill = time, width = 10)) +
    geom_bar(stat = "identity", position = 'identity') +
    scale_fill_brewer(palette="Set1") +
    theme_cowplot() +
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 60, hjust = 1)) +
    scale_x_continuous(breaks=seq(0, 5000, 500)) + 
    labs(x="Position", y="Normalized counts (counts/total reads)") +
    ggtitle("28S rRNA coverage plots")
plot_28S

5.8s rRNA

data_dir_5.8S = "~/Dropbox (Hesselberth Lab)/Rachel_data/EndoU_project/5.8S/exp2/"
data_files_5.8S = list.files(data_dir_5.8S, full.names = T)

read_file <- function(x) {
  df <- readr::read_tsv(x, col_names = c("chrom", "start", "end", "count", "normalized_count", "dinuc"))
  df$name <- basename(x)
  df
}

table_5.8S <- purrr::map_df(data_files_5.8S, read_file) %>%
  mutate(name = str_replace(name, ".r5.8s.bg", "")) %>%
  separate(name, into = c('cell', 'virus', 'time'), sep = '_')

datatable(table_5.8S)
plot_5.8S <- ggplot(table_5.8S, aes(x = end, y = normalized_count, fill = time)) +
    geom_bar(stat = "identity", position = 'identity') +
    scale_fill_brewer(palette="Set1") + 
    theme_cowplot() + 
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 60, hjust = 1)) +
    scale_x_continuous(breaks=seq(0, 200, 20)) + 
    labs(x="Position", y="Normalized counts (counts/total reads)") +
    ggtitle("5.8S rRNA coverage plots")
plot_5.8S

RNase L substractive coverage analysis of rRNA reads for all cell types by type of viral infection

The normalized counts detected in RNase L KO cells for each type of viral infection were subtracted from the normalized counts detected in WT B6 cells. This substractive analysis will emphasize RNase L dependent cleavage events by reporting signals that occur only in the presence of RNase L.

#18S rRNA RNase L substractive analysis 

subtractive_18S <- table_18S %>% 
  dplyr::select(-count, -dinuc) %>% 
  spread(cell, normalized_count) 
subtractive_18S[is.na(subtractive_18S)] <- 0

subtractive_18S <- subtractive_18S %>% 
  mutate(B6_RNaseL = B6 - RNaseL) %>% 
  dplyr::select(start:end, virus:time, B6_RNaseL) %>% 
  gather(cell, normalized_count, B6_RNaseL)
                                      
#18s rRNA RNase L dependent cleavage plots

sub18S_plot <- ggplot(subtractive_18S, aes(x = end, y = normalized_count, fill = time, width = 1)) +
    geom_bar(stat = "identity", position = 'identity') +
    #geom_line(aes(color = time)) + 
    scale_fill_brewer(palette = 'Set1') + 
    theme_cowplot() +
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 60, hjust = 1)) +
    labs(x="Position", y="Normalized counts (counts/total reads)") + 
    scale_y_continuous(limits = c(0 , 0.2)) +
    scale_x_continuous(breaks=seq(0, 2000, 250)) + 
    ggtitle("18s rRNA RNase L dependent cleavage plots")
sub18S_plot

#28S rRNA RNase L substractive analysis 

subtractive_28S <- table_28S %>% 
  dplyr::select(-count, -dinuc) %>% 
  spread(cell, normalized_count) 
subtractive_28S[is.na(subtractive_28S)] <- 0

subtractive_28S <- subtractive_28S %>% 
  mutate(B6_RNaseL = B6 - RNaseL) %>% 
  dplyr::select(start:end, virus:time, B6_RNaseL) %>%      
  gather(cell, normalized_count, B6_RNaseL)

#28s rRNA RNase L dependent cleavage plots
                                      
sub28S_plot <- ggplot(subtractive_28S, aes(x = end, y = normalized_count, fill = time, width = 5)) +
    geom_bar(stat = "identity", position = 'identity') +
    scale_fill_brewer(palette = 'Set1') + 
    theme_cowplot() +
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 90, hjust = 1)) +                  scale_y_continuous(limits = c(0 , 0.2)) +
    scale_x_continuous(breaks=seq(0, 5000, 500)) + 
   ggtitle("28s rRNA RNase L dependent cleavage plots")
sub28S_plot

#5.8S rRNA RNase L substractive analysis 

subtractive_5.8S <- table_5.8S %>% 
  dplyr::select(-count, -dinuc) %>% 
  spread(cell, normalized_count) 
subtractive_5.8S[is.na(subtractive_5.8S)] <- 0

subtractive_5.8S <- subtractive_5.8S %>% 
  mutate(B6_RNaseL = B6 - RNaseL) %>% 
  dplyr::select(start:end, virus:time, B6_RNaseL) %>%    
  gather(cell, normalized_count, B6_RNaseL)

#5s rRNA RNase L dependent cleavage plots
                                      
sub5.8S_plot <- ggplot(subtractive_5.8S, aes(x = end, y = normalized_count, fill = time)) +
    geom_bar(stat = "identity", position = 'identity') +
    scale_fill_brewer(palette = 'Set1') + 
    theme_cowplot() + 
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 90, hjust = 1)) +              
    scale_y_continuous(limits = c(0 , 0.03)) +
    scale_x_continuous(breaks=seq(0, 200, 20)) + 
    ggtitle("5.8s rRNA RNase L dependent cleavage plots")
sub5.8S_plot

EndoU mutant (nsp15) substractive coverage analysis of MHV (+) strand for all cell types by type of viral infection

This is very similar to the analysis above, expect it will substract signal occuring in the abscence of nsp15 actviity, which will emphasize sites specific to nsp15 cleavage actviity.

#18S rRNA EndoU substractive analysis 

subtractive_nsp15_18S <- table_18S %>% 
  dplyr::select(-count, -dinuc) %>% 
  spread(virus, normalized_count) 
subtractive_nsp15_18S[is.na(subtractive_nsp15_18S)] <- 0

subtractive_nsp15_18S <- subtractive_nsp15_18S %>%       
  mutate(MHVV_nsp15 = MHVV - nsp15) %>%
  mutate(ns2_nsp15 = ns2 - nsp15) %>%
  mutate(mock_nsp15 = mock - nsp15) %>%
  dplyr::select(start:end, cell:time, MHVV_nsp15:mock_nsp15) %>% 
  gather(virus, normalized_count, MHVV_nsp15:mock_nsp15)
                                      
subnsp15_18S_plot <- ggplot(subtractive_nsp15_18S, aes(x = end, y = normalized_count, fill = time, width = 5)) +
    geom_bar(stat = "identity", position = 'identity') + 
    scale_fill_brewer(palette = 'Set1') + 
    theme_cowplot() + 
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 60, hjust = 1)) +  
    scale_y_continuous(limits = c(0.0, 0.2)) +
    scale_x_continuous(breaks=seq(0, 2000, 250)) + 
    ggtitle("18S rRNA EndoU substractive analysis ")
subnsp15_18S_plot

#28S

subtractive_nsp15_28S <- table_28S %>% 
  dplyr::select(-count, -dinuc) %>% 
  spread(virus, normalized_count) 
subtractive_nsp15_28S[is.na(subtractive_nsp15_28S)] <- 0

subtractive_nsp15_28S <- subtractive_nsp15_28S %>%   
  mutate(MHVV_nsp15 = MHVV - nsp15) %>% 
  mutate(ns2_nsp15 = ns2 - nsp15) %>% mutate(mock_nsp15 = mock - nsp15) %>% 
  dplyr::select(start:end, cell:time, MHVV_nsp15:mock_nsp15) %>%    
  gather(virus, normalized_count, MHVV_nsp15:mock_nsp15)
                                      
subnsp15_28S_plot <- ggplot(subtractive_nsp15_28S, aes(x = end, y = normalized_count, fill = time, width = 10)) +
    geom_bar(stat = "identity", position = 'identity') +
    scale_fill_brewer(palette = 'Set1') + 
    theme_cowplot() + 
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 90, hjust = 1)) +     
    scale_y_continuous(limits = c(0.0, 0.2)) +
    scale_x_continuous(breaks=seq(0, 5000, 500)) + 
    ggtitle("28S rRNA EndoU substractive analysis ")
subnsp15_28S_plot

#5.8S

subtractive_nsp15_5.8S <- table_5.8S %>% 
  dplyr::select(-count, -dinuc) %>% 
  spread(virus, normalized_count) 
subtractive_nsp15_5.8S[is.na(subtractive_nsp15_5.8S)] <- 0

subtractive_nsp15_5.8S <- subtractive_nsp15_5.8S %>% 
  mutate(MHVV_nsp15 = MHVV - nsp15) %>% 
  mutate(ns2_nsp15 = ns2 - nsp15) %>% 
  mutate(mock_nsp15 = mock - nsp15) %>% 
  dplyr::select(start:end, cell:time, MHVV_nsp15:mock_nsp15) %>%
  gather(virus, normalized_count, MHVV_nsp15:mock_nsp15)
                                      
subnsp15_5.8S_plot <- ggplot(subtractive_nsp15_5.8S, aes(x = end, y = normalized_count, fill = time)) +
    geom_bar(stat = "identity", position = 'identity') +
    scale_fill_brewer(palette = 'Set1') + 
    theme_cowplot() + 
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 90, hjust = 1)) +                   scale_y_continuous(limits = c(0.0, 0.02)) +
    scale_x_continuous(breaks=seq(0, 200, 20)) + 
    ggtitle("5.8S rRNA EndoU substractive analysis ")
subnsp15_5.8S_plot

Fold-change for RNaseL acitivity by rRNA

In this analysis, all positions in the MHV positive strand RNA with more than 20 reads were queried to identify sites with equal to or greater than a 5-fold decrease in signal comparing B6 WT cells and IFNAR KO cells to RNaseL KO cells (B6/RNaseL and IFNAR/RNaseL).

This analysis is independent of viral infection and just asks which sites change the most when RNaseL is absent.

18s

change_RNaseL_18S <- table_18S %>% 
  filter(count >= 20) %>%
  dplyr::select(-count, -dinuc) %>% 
  spread(cell, normalized_count)
change_RNaseL_18S[is.na(change_RNaseL_18S)] <- 0

change_RNaseL_18S <- change_RNaseL_18S %>% 
  mutate(B6_change = B6/RNaseL) %>% 
  gather(cell_comp, fold_change, B6_change) %>%
  filter(fold_change > 0 & fold_change != Inf) %>%
  filter(fold_change >= 5) %>%
  group_by(start) %>%
  unique() %>%
  arrange(desc(fold_change))

datatable(change_RNaseL_18S)
change_RNaseL_18S_graph <- change_RNaseL_18S %>% 
  ggplot(aes(x = start, y = fold_change, fill = cell_comp, width = 1)) +
  geom_bar(stat = "identity", position = 'identity') + 
  scale_fill_brewer(palette="Set1") +
  facet_grid(virus ~ cell_comp) +
  theme_cowplot() +
  labs(x="Position", y="fold_change") +
  theme(axis.text.x = element_text(angle = 60, hjust = 1))
change_RNaseL_18S_graph

28s

change_RNaseL_28S <- table_28S %>% 
  filter(count >= 20) %>%
  dplyr::select(-count, -dinuc) %>% 
  spread(cell, normalized_count)
change_RNaseL_28S[is.na(change_RNaseL_28S)] <- 0

change_RNaseL_28S <- change_RNaseL_28S %>% 
  mutate(B6_change = B6/RNaseL) %>% 
  gather(cell_comp, fold_change, B6_change) %>%
  filter(fold_change > 0 & fold_change != Inf) %>%
  filter(fold_change >= 5) %>%
  group_by(start) %>%
  unique() %>%
  arrange(desc(fold_change))

datatable(change_RNaseL_28S)
change_RNaseL_28S_graph <- change_RNaseL_28S %>% 
  ggplot(aes(x = start, y = fold_change, fill = cell_comp, width = 15)) +
  geom_bar(stat = "identity", position = 'identity') + 
  scale_fill_brewer(palette="Set1") +
  facet_grid(virus ~ cell_comp) +
  theme_cowplot() +
  labs(x="Position", y="fold_change") +
  theme(axis.text.x = element_text(angle = 60, hjust = 1))
change_RNaseL_28S_graph

5.8s

change_RNaseL_5.8S <- table_5.8S %>% 
  filter(count >= 20) %>%
  dplyr::select(-count, -dinuc) %>% 
  spread(cell, normalized_count)
change_RNaseL_5.8S[is.na(change_RNaseL_5.8S)] <- 0

change_RNaseL_5.8S <- change_RNaseL_5.8S %>% 
  mutate(B6_change = B6/RNaseL) %>% 
  gather(cell_comp, fold_change, B6_change) %>%
  filter(fold_change > 0 & fold_change != Inf) %>%
  filter(fold_change >= 5) %>%
  group_by(start) %>%
  unique() %>%
  arrange(desc(fold_change))

datatable(change_RNaseL_5.8S)

Fold-change for Nsp15 activity by rRNA

In this analysis, all positions in the MHV positive strand RNA with more than 20 reads were queried to identify sites with equal to or greater than a 5-fold decrease in signal comparing cells infected with WT/ns2 mutant virus to nsp15 mutant virus (MHV WT/nsp15 and ns2/nsp15).

This analysis is independent of cell type and just asks which sites change the most when nsp15 activity is lost. Thus, these sites are not independent of RNaseL actviity.

18s

change_nsp15_18S <- table_18S %>% 
  filter(count >= 20) %>%
  dplyr::select(-count, -dinuc) %>% 
  spread(virus, normalized_count)
change_nsp15_18S[is.na(change_nsp15_18S)] <- 0

change_nsp15_18S <- change_nsp15_18S %>% 
  mutate(MHVV_change = MHVV/nsp15) %>% 
  mutate(mock_change = mock/nsp15) %>%
  mutate(ns2_change = ns2/nsp15) %>% 
  gather(viral_comp, fold_change, MHVV_change:ns2_change) %>%
  filter(fold_change > 0 & fold_change != Inf) %>%
  filter(fold_change >= 5) %>%
  group_by(start) %>%
  unique() %>%
  arrange(desc(fold_change))

datatable(change_nsp15_18S)
change_nsp15_18S_graph <- change_nsp15_18S %>%
  ggplot(aes(x = start, y = fold_change, fill = viral_comp, width=5)) +
  geom_bar(stat = "identity", position = 'identity') + 
  scale_fill_brewer(palette="Set1") +
  facet_grid(viral_comp ~ cell) +
  theme_cowplot() +
  labs(x="Position", y="fold_change") +
  theme(axis.text.x = element_text(angle = 60, hjust = 1))
change_nsp15_18S_graph

interest_18S <- ggplot(table_18S, aes(x = start, y = normalized_count, fill = time)) +
    geom_bar(stat = "identity", position = 'identity') +
    scale_fill_brewer(palette = 'Set1') + 
    theme_cowplot() +
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 60, hjust = 1)) +
    labs(x="Position", y="Normalized counts") +
    xlim(538, 546)
interest_18S
## Warning: Removed 26812 rows containing missing values (geom_bar).

28s

change_nsp15_28S <- table_28S %>% 
  filter(count >= 20) %>%
  dplyr::select(-count, -dinuc) %>% 
  spread(virus, normalized_count)
change_nsp15_28S[is.na(change_nsp15_28S)] <- 0

change_nsp15_28S <- change_nsp15_28S %>% 
  mutate(MHVV_change = MHVV/nsp15) %>% 
  mutate(mock_change = mock/nsp15) %>%
  mutate(ns2_change = ns2/nsp15) %>% 
  gather(viral_comp, fold_change, MHVV_change:ns2_change) %>%
  filter(fold_change > 0 & fold_change != Inf) %>%
  filter(fold_change >= 5) %>%
  group_by(start) %>%
  unique() %>%
  arrange(desc(fold_change))

datatable(change_nsp15_28S)
change_nsp15_28S_graph <- change_nsp15_28S %>%
  ggplot(aes(x = start, y = fold_change, fill = viral_comp, width=10)) +
  geom_bar(stat = "identity", position = 'identity') + 
  scale_fill_brewer(palette="Set1") +
  facet_grid(viral_comp ~ cell) +
  theme_cowplot() +
  labs(x="Position", y="fold_change") +
  theme(axis.text.x = element_text(angle = 60, hjust = 1))
change_nsp15_28S_graph

interest_28S <- ggplot(table_28S, aes(x = start, y = normalized_count, fill = time)) +
    geom_bar(stat = "identity", position = 'identity') +
    scale_fill_brewer(palette = 'Set1') + 
    theme_cowplot() +
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 60, hjust = 1)) +
    labs(x="Position", y="Normalized counts") +
    xlim(565, 573)
interest_28S
## Warning: Removed 47831 rows containing missing values (geom_bar).

5.8S

change_nsp15_5.8S <- table_5.8S %>% 
  filter(count >= 20) %>%
  dplyr::select(-count, -dinuc) %>% 
  spread(virus, normalized_count)
change_nsp15_5.8S[is.na(change_nsp15_5.8S)] <- 0

change_nsp15_5.8S <- change_nsp15_5.8S %>% 
  mutate(MHVV_change = MHVV/nsp15) %>% 
  mutate(mock_change = mock/nsp15) %>%
  #mutate(ns2_change = ns2/nsp15) %>% 
  gather(viral_comp, fold_change, MHVV_change:mock_change) %>%
  filter(fold_change > 0 & fold_change != Inf) %>%
  filter(fold_change >= 5) %>%
  group_by(start) %>%
  unique() %>%
  arrange(desc(fold_change))

datatable(change_nsp15_5.8S)

Fold-change for Nsp15 muant and RNaseL KO reads

Same analysis as above focused in RNaseL KO cells.

#18s 

change_nsp15RNaseL_18S <- change_nsp15_18S %>% 
  mutate(MHVV_change = MHVV/nsp15) %>% 
  mutate(mock_change = mock/nsp15) %>%
  mutate(ns2_change = ns2/nsp15) %>% 
  gather(viral_comp, fold_change, MHVV_change:ns2_change) %>%
  filter(fold_change > 0 & fold_change != Inf) %>%
  filter(fold_change >= 5) %>%
  filter(cell == "RNaseL") %>%
  group_by(start) %>%
  unique() %>%
  arrange(desc(fold_change))

datatable(change_nsp15RNaseL_18S)
change_nsp15RNaseL_18S_graph <- change_nsp15RNaseL_18S %>%
  ggplot(aes(x = start, y = fold_change, fill = viral_comp, width=10)) +
  geom_bar(stat = "identity", position = 'identity') + 
  scale_fill_brewer(palette="Set1") +
  facet_grid(viral_comp ~ cell) +
  theme_cowplot() +
  labs(x="Position", y="fold_change") +
  theme(axis.text.x = element_text(angle = 60, hjust = 1))
change_nsp15RNaseL_18S_graph

#28s

change_nsp15RNaseL_28S <- change_nsp15_28S %>% 
  mutate(MHVV_change = MHVV/nsp15) %>% 
  mutate(mock_change = mock/nsp15) %>%
  mutate(ns2_change = ns2/nsp15) %>% 
  gather(viral_comp, fold_change, MHVV_change:ns2_change) %>%
  filter(fold_change > 0 & fold_change != Inf) %>%
  filter(fold_change >= 5) %>%
  filter(cell == "RNaseL") %>%
  group_by(start) %>%
  unique() %>%
  arrange(desc(fold_change))

datatable(change_nsp15RNaseL_28S)
change_nsp15RNaseL_28S_graph <- change_nsp15RNaseL_28S %>%
  ggplot(aes(x = start, y = fold_change, fill = viral_comp, width=10)) +
  geom_bar(stat = "identity", position = 'identity') + 
  scale_fill_brewer(palette="Set1") +
  facet_grid(viral_comp ~ cell) +
  theme_cowplot() +
  labs(x="Position", y="fold_change") +
  theme(axis.text.x = element_text(angle = 60, hjust = 1))
change_nsp15RNaseL_28S_graph

#5.8s

change_nsp15RNaseL_5.8S <- change_nsp15_5.8S %>% 
  mutate(MHVV_change = MHVV/nsp15) %>% 
  mutate(mock_change = mock/nsp15) %>%
  #mutate(ns2_change = ns2/nsp15) %>% 
  gather(viral_comp, fold_change, MHVV_change:mock_change) %>%
  filter(fold_change > 0 & fold_change != Inf) %>%
  filter(fold_change >= 5) %>%
  filter(cell == "RNaseL") %>%
  group_by(start) %>%
  unique() %>%
  arrange(desc(fold_change))

datatable(change_nsp15RNaseL_5.8S)

Calcualting dinucelotide frequencies for all cell types by type of viral infection

Performing a dinucleotide frequency analysis will help us to confirm RNaseL signatures as a positive control and investigate a potential sequence preference for nsp15 cleavage.

dinuc <- c("AA","GA", "CA", "UA","AC", "CC", "GC", "UC", "AG", "CG", "GG", "UG", "AU", "CU", "GU", "UU")
df_dinuc <- data_frame(dinuc)

#18S dinuc frequency 

frequencies_18S <- function(x) {
  df <- readr::read_tsv(x, col_names = c("chrom", "start", "end", "count",      "normalized_count", "dinuc"))
  df <- aggregate(cbind(count) ~ dinuc, data = df, sum)
  df <- left_join(df_dinuc, df) %>% 
    replace_na(list(count = 0)) %>% 
    mutate(freq = count/sum(count)) 
  df$name <- basename(x)
  df %>% mutate(name = str_replace(name, ".r18s.bg", "")) %>%
  separate(name, into = c('cell', 'virus', 'time'))
}

freq_18S <- purrr::map_df(data_files_18S, frequencies_18S)

#28S dinuc frequency 

frequencies_28S <- function(x) {
  df <- readr::read_tsv(x, col_names = c("chrom", "start", "end", "count",      "normalized_count", "dinuc"))
  df <- aggregate(cbind(count) ~ dinuc, data = df, sum)
  df <- left_join(df_dinuc, df) %>% 
    replace_na(list(count = 0)) %>% 
    mutate(freq = count/sum(count)) 
  df$name <- basename(x)
  df %>% mutate(name = str_replace(name, ".r28s.bg", "")) %>%
  separate(name, into = c('cell', 'virus', 'time'))
}

freq_28S <- purrr::map_df(data_files_28S, frequencies_28S)

5.8s

frequencies_5.8S <- function(x) {
  df <- readr::read_tsv(x, col_names = c("chrom", "start", "end", "count",      "normalized_count", "dinuc"))
  df <- aggregate(cbind(count) ~ dinuc, data = df, sum)
  df <- left_join(df_dinuc, df) %>% 
    replace_na(list(count = 0)) %>% 
    mutate(freq = count/sum(count)) 
  df$name <- basename(x)
  df %>% mutate(name = str_replace(name, ".r5.8s.bg", "")) %>%
  separate(name, into = c('cell', 'virus', 'time'))
}

freq_5.8S <- purrr::map_df(data_files_5.8S, frequencies_5.8S)

Graphing dinucleotide frequencies for all cell types by infection status

#18S dinuc freq plots 

freq_18S_plot <- freq_18S %>%
  ggplot(aes(x = dinuc,y = freq, fill = time)) + 
  scale_fill_brewer(palette = 'Set1') + 
  scale_x_discrete(limits=c("AA","GA", "CA", "UA","AC", "CC", "GC", "UC", "AG", "CG", "GG",     "UG", "AU", "CU", "GU", "UU")) + 
  geom_bar(stat = "identity", position = 'dodge') + 
  theme_cowplot() +
  facet_grid(virus ~ cell) +  
  theme(axis.text.x = element_text(angle = 60, hjust = 1, size = 8)) +
  ggtitle("18S dinucleotide frequency plots ") 
freq_18S_plot

#28S dinuc freq plots 

freq_28S_plot <- freq_28S %>%
  ggplot(aes(x = dinuc,y = freq, fill = time)) + 
  scale_fill_brewer(palette = 'Set1') + 
  scale_x_discrete(limits=c("AA","GA", "CA", "UA","AC", "CC", "GC", "UC", "AG", "CG", "GG",     "UG", "AU", "CU", "GU", "UU")) + 
  geom_bar(stat = "identity", position = 'dodge') + 
  theme_cowplot() + 
  facet_grid(virus ~ cell) + 
  theme(axis.text.x = element_text(angle = 60, hjust = 1, size = 8)) +
  ggtitle("28S dinucleotide frequency plots ") 
freq_28S_plot

#5.8S dinuc freq plots 

freq_5.8S_plot <- freq_5.8S %>%
  ggplot(aes(x = dinuc,y = freq, fill = time)) + 
  scale_fill_brewer(palette = 'Set1') + 
  scale_x_discrete(limits=c("AA","GA", "CA", "UA","AC", "CC", "GC", "UC", "AG", "CG", "GG",     "UG", "AU", "CU", "GU", "UU")) + 
  geom_bar(stat = "identity", position = 'dodge') + 
  theme_cowplot() + 
  facet_grid(virus ~ cell) + 
  theme(axis.text.x = element_text(angle = 60, hjust = 1, size = 8)) +
  ggtitle("5.8S dinucleotide frequency plots ") 
freq_5.8S_plot

RNase L substractive dinucleotide analysis of for all cell types by viral infection

This is similar to the previous coverage substractive analysis. These plots display dinucleotde cleavage frequencies dependent on RNase L by removing the frequencies detected in the abscence of RNase L.

#18S

subtractive_18S <- freq_18S %>% 
  dplyr::select(dinuc, freq:time) %>% 
  spread(cell, freq) %>% 
  mutate(B6_RNaseL = B6 - RNaseL) %>%
  dplyr::select(dinuc:time, B6_RNaseL) %>% 
  gather(cell, freq, B6_RNaseL)

sub18S_freq_plot <- subtractive_18S %>% 
  ggplot(aes(x = dinuc , y = freq)) + 
  scale_fill_brewer(palette = 'Set1') + 
  scale_x_discrete(limits=c("AA","GA", "CA", "UA","AC", "CC", "GC", "UC", "AG", "CG", "GG",     "UG", "AU", "CU", "GU",      "UU")) + 
  geom_bar(aes(fill = time), stat = "identity", position = 'dodge') + 
  theme_cowplot() + 
  facet_grid(virus ~ cell) + 
  scale_y_continuous(limits = c(0.00, 0.04)) + 
  theme(axis.text.x = element_text(angle = 60, hjust = 1, size = 8)) +
  ggtitle("18S RNase L subtractive dinucleotide frequency plots ") 
sub18S_freq_plot

#28S

subtractive_28S <- freq_28S %>% 
  dplyr::select(dinuc, freq:time) %>% 
  spread(cell, freq) %>% 
  mutate(B6_RNaseL = B6 - RNaseL) %>%
  dplyr::select(dinuc:time, B6_RNaseL) %>% 
  gather(cell, freq, B6_RNaseL)

sub28S_freq_plot <- subtractive_28S %>%
  ggplot(aes(x = dinuc , y = freq)) + 
  scale_fill_brewer(palette = 'Set1') + 
  scale_x_discrete(limits=c("AA","GA", "CA", "UA","AC", "CC", "GC", "UC", "AG", "CG", "GG",     "UG", "AU", "CU", "GU",      "UU")) + 
  geom_bar(aes(fill = time), stat = "identity", position = 'dodge') + 
  theme_cowplot() + 
  facet_grid(virus ~ cell) + 
  theme(axis.text.x = element_text(angle = 60, hjust = 1, size = 8)) + 
  scale_y_continuous(limits = c(-0.0, 0.06)) +
  ggtitle("28S RNase L subtractive dinucleotide frequency plots ") 
sub28S_freq_plot

#5.8S

subtractive_5.8S <- freq_5.8S %>% 
  dplyr::select(dinuc, freq:time) %>% 
  spread(cell, freq) %>% 
  mutate(B6_RNaseL = B6 - RNaseL) %>% 
  dplyr::select(dinuc:time, B6_RNaseL) %>% 
  gather(cell, freq, B6_RNaseL)

sub5.8S_freq_plot <- subtractive_5.8S %>%
  ggplot(aes(x = dinuc , y = freq)) + 
  scale_fill_brewer(palette = 'Set1') + 
  scale_x_discrete(limits=c("AA","GA", "CA", "UA","AC", "CC", "GC", "UC", "AG", "CG", "GG", "UG", "AU", "CU", "GU",      "UU")) + 
  geom_bar(aes(fill = time), stat = "identity", position = 'dodge') + 
  theme_cowplot() + 
    facet_grid(virus ~ cell) + 
    theme(axis.text.x = element_text(angle = 60, hjust = 1, size = 8)) + 
    scale_y_continuous(limits = c(-0.0, 0.06)) +
    ggtitle("5S RNase L subtractive dinucleotide frequency plots ") 
sub5.8S_freq_plot

Nsp15 subtractive dinucleotide analysis of for all cell types by viral infection

#18S

endoU_subtractive_18S <- freq_18S %>% 
  dplyr::select(dinuc, freq:time) %>% 
  spread(virus, freq) %>% 
  mutate(MHVV_nsp15 = MHVV - nsp15) %>% 
  mutate(ns2_nsp15 = ns2 - nsp15) %>% 
  mutate(mock_nsp15 = mock - nsp15) %>% 
  dplyr::select(dinuc:time, MHVV_nsp15:mock_nsp15) %>% 
  gather(virus, freq, MHVV_nsp15:mock_nsp15)

endoU_sub18S_freq_plot <- endoU_subtractive_18S %>% 
  ggplot(aes(x = dinuc , y = freq, fill = time)) + 
  scale_fill_brewer(palette = 'Set1') + 
  scale_x_discrete(limits=c("AA","GA", "CA", "UA","AC", "CC", "GC", "UC", "AG", "CG", "GG",     "UG", "AU", "CU", "GU",      "UU")) + 
  geom_bar(stat = "identity", position = 'dodge') + 
  theme_cowplot() + 
  scale_y_continuous(limits = c(0.00, 0.06)) +
  facet_grid(virus ~ cell) + 
  theme(axis.text.x = element_text(angle = 60, hjust = 1, size = 8)) +
  ggtitle("18S nsp15 subtractive dinucleotide frequency plots ") 
endoU_sub18S_freq_plot

#28S

endoU_subtractive_28S <- 
  freq_28S %>% 
  dplyr::select(dinuc, freq:time) %>% 
  spread(virus, freq) %>% 
  mutate(MHVV_nsp15 = MHVV - nsp15) %>% 
  mutate(ns2_nsp15 = ns2 - nsp15) %>% 
  mutate(mock_nsp15 = mock - nsp15) %>% 
  dplyr::select(dinuc:time, MHVV_nsp15:mock_nsp15) %>% 
  gather(virus, freq, MHVV_nsp15:mock_nsp15)

endoU_sub28S_freq_plot <- endoU_subtractive_28S %>% 
  ggplot(aes(x = dinuc , y = freq, fill = time)) + 
  scale_fill_brewer(palette = 'Set1') + 
  scale_x_discrete(limits=c("AA","GA", "CA", "UA","AC", "CC", "GC", "UC", "AG", "CG", "GG",     "UG", "AU", "CU", "GU", "UU")) + 
  geom_bar(stat = "identity", position = 'dodge') + 
  theme_cowplot() + 
  scale_y_continuous(limits = c(0.0, 0.06)) +
  facet_grid(virus ~ cell) + 
  theme(axis.text.x = element_text(angle = 60, hjust = 1, size = 8)) +
  ggtitle("28S nsp15 subtractive dinucleotide frequency plots ") 
endoU_sub28S_freq_plot

#5.8S

endoU_subtractive_5.8S <- freq_5.8S %>% 
  dplyr::select(dinuc, freq:time) %>% 
  spread(virus, freq) %>% 
  mutate(MHVV_nsp15 = MHVV - nsp15) %>% 
  mutate(ns2_nsp15 = ns2 - nsp15) %>% 
  mutate(mock_nsp15 = mock - nsp15) %>% 
  dplyr::select(dinuc:time, MHVV_nsp15:mock_nsp15) %>% 
  gather(virus, freq, MHVV_nsp15:mock_nsp15)

endoU_sub5.8S_freq_plot <- endoU_subtractive_5.8S %>% 
  ggplot(aes(x = dinuc , y = freq, fill = time)) + 
  scale_fill_brewer(palette = 'Set1') + 
  scale_x_discrete(limits=c("AA","GA", "CA", "UA","AC", "CC", "GC", "UC", "AG", "CG", "GG",     "UG", "AU", "CU", "GU", "UU")) + 
  geom_bar(aes(fill = time), stat = "identity", position = 'dodge') + 
  theme_cowplot() + 
  scale_y_continuous(limits = c(0.0, 0.06)) +
  facet_grid(cell ~ virus) + 
  theme(axis.text.x = element_text(angle = 60, hjust = 1, size = 8)) +
  ggtitle("5S nsp15 subtractive dinucleotide frequency plots ") 
endoU_sub5.8S_freq_plot